#ifndef __SPHERE_H__
#define __SPHERE_H__

#include "Assembly.h"
#include "Face.h"
#include "Matrix4D.h"

#include <vector>

using std::vector;

// reimplementation of GLUsphere
// 	sphere is symmetric on (0, 0, 0)

class Sphere : public Assembly
{
public:
	// ctor
	Sphere();
	
	Sphere(float r);
	
	Sphere(float r, const Vertex& pos);
	Sphere(float r, float x, float y, float z);
	
	// dtor
	virtual ~Sphere();
	
	// getter/setter methods of sphere's radius
	const float& radius() const;
	float& radius();
	
private:
	// setup vertex, normals, faces
	void init();
	
	// update the vertex/normals
	void update_vertex();
	
	// radius of the sphere
	float m_r;
	
	// vertex, normals (though the vertex is its own normal,
	// they have to be handled differently due to Modelview-Transforms)
	// [stack][slice]
	vector<vector<Vertex*> > m_vertex, m_normal;
	
	static int STACKS, SLICES;
};

#endif

